package demo;

public class MCla {
    public static void main(String[] args) {
        Student stu = new Student( ) ;
        stu.setName("张冬");
        stu.setDepartment("计算机系");
        System.out.println(stu.getName());
        System. out. println("系别:"+ stu. getDepartment( ) );
    }
}

class Person{
    private String name;
    public void setName( String newName){
        name = newName;
    }
    public String getName( ) {
        return name;
    }
}

class Student extends Person{
    private String dep;
    public void setDepartment( String newDep) {
        dep = newDep;
    }
    public String getDepartment( ){
        return dep;
    }
}

